﻿//ServerCredentials.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.Algo
{
	using System;
	using System.Security;

	using Ecng.Common;

	/// <summary>
	/// Класс, хранящих в себе логин и пароль для доступа к сервисам http://stocksharp.com
	/// </summary>
	public sealed class ServerCredentials
	{
		private ServerCredentials()
		{
		}

		private static readonly Lazy<ServerCredentials> _instance = new Lazy<ServerCredentials>(() => new ServerCredentials());

		/// <summary>
		/// Объект класса <see cref="ServerCredentials"/>.
		/// </summary>
		public static ServerCredentials Instance
		{
			get { return _instance.Value; }
		}

		private SecureString _login = new SecureString();

		/// <summary>
		/// Логин.
		/// </summary>
		public string Login
		{
			get { return _login.To<string>(); }
			set { _login = value.To<SecureString>(); }
		}

		private SecureString _password = new SecureString();

		/// <summary>
		/// Пароль.
		/// </summary>
		public string Password
		{
			get { return _password.To<string>(); }
			set { _password = value.To<SecureString>(); }
		}
	}
}